Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which of the following regular expressions de... Start Learning for Free
Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?
  • a)
    (0 + 1) * 11(0 + 1) *
  • b)
    0 * 110 *
  • c)
    0 * 10 * 10 *
  • d)
    (0 + 1) * 1(0 + 1) * 1 (0 + 1) *
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Which of the following regular expressions describes the language over...
A) with at least 2 consecutive 1's, any no of 0's and any no of 1's
B) exactly two consecutive 1's
C)exactly two 1's but need not be consecutive
D) any no of 1's and 0's with at least two 1's
View all questions of this test
Most Upvoted Answer
Which of the following regular expressions describes the language over...
Answer:

The regular expression that describes the language over {0, 1} consisting of strings that contain exactly two 1s is option 'c' - 0*10*10*.

To understand why option 'c' is the correct answer, let's break down the regular expression and analyze it step by step:

0*: This part of the regular expression matches any number (including zero) of 0s at the beginning of the string.

10*: This part matches a single 1 followed by any number (including zero) of 0s.

10*: This part matches a second occurrence of a single 1 followed by any number (including zero) of 0s.

Combining these three parts together, we can see that the regular expression matches strings that start with any number of 0s, followed by a single 1, followed by any number of 0s, followed by a second occurrence of a single 1, and finally followed by any number of 0s.

Let's analyze how this regular expression matches strings with exactly two 1s:

- 0110: The regular expression matches this string as it starts with 0s, followed by a 1, followed by 0s, followed by a second occurrence of a 1, and ends with 0s.
- 0011: The regular expression also matches this string as it starts with 0s, followed by a 1, followed by 0s, followed by a second occurrence of a 1, and ends with 0s.

On the other hand, the other options do not correctly describe the language:
- Option 'a' matches strings with at least two 1s, but it also matches strings with more than two 1s.
- Option 'b' matches strings with at most two 1s, but it also matches strings with fewer than two 1s.
- Option 'd' matches strings with at least two 1s, but it does not ensure that there are no more than two 1s.

Therefore, option 'c' is the correct regular expression that describes the language over {0, 1} consisting of strings that contain exactly two 1s.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer?
Question Description
Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer?.
Solutions for Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer?, a detailed solution for Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? has been provided alongside types of Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev